package com.example.demo.web;

import com.example.demo.bean.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author gatts, 2020/8/5 21:20
 */
@RestController
public class HelloController {

    /**
     * 验证去掉json支持是否还支持序列化
     *      去掉后再请求 http://localhost:8080/hello，会500报错
     *
     * @return
     */
    @GetMapping("hello")
    public User hello(){
        User user = new User();
        user.setUsername("晓敏");
        user.setBirthDay(new Date());
        return user;
    }

}


